package com.wowo.hello;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.applet.AppletContext;

public class HelloWorldApp {
    public static void main(String[] args) {
        //老式
//        HelloWorld hw = new HelloWorld();
//        hw.sayHello();

        //获得Spring Ioc容器对象
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("hello/hello.xml");
        System.out.println("=================================");
        //获得容器创建的对象
        //HelloWorld helloWorld =(HelloWorld) applicationContext.getBean("helloWorld");
        HelloWorld helloWorld = applicationContext.getBean(HelloWorld.class);
        //调用对象上的方法
        helloWorld.sayHello();
    }
}
